﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using r4u.business.logic.layer.REGISTER;

namespace r4u.Controllers
{
    public class HomeController : Controller
    {
        //
        // GET: /Home/

        public ActionResult Index()
        {
            if (Request.IsAuthenticated)
            {
                User user = new User();
                string email = HttpContext.User.Identity.Name;
                string status = user.GetStatus(email);

                switch (status)
                {
                    case "CREATED":
                        return RedirectToAction("Index", "Verify");
                    case "VERIFIED":
                        return RedirectToAction("Index", "Payment");
                    default:
                        return RedirectToAction("Index", "DashBoard");
                }
            }
            else
            {
                return View();
            }
        }

    }
}
